﻿using System;
using System.Web.Mvc;
using FluentNHibernate.Conventions;

namespace BoneSystem.Models
{
    public class CadastroRestModel
    {
        public Type ClassType { get; set; }
        public string FormName { get; set; }
        public MvcHtmlString PartialForm { get; set; }
        public string DialogName { get; set; }
        public string DialogTitle { get; set; }
        public string ControllerName { get; set; }
        public string Area { get; set; }
        public string UrlNewJson
        {
            get
            {
                if (Area.IsNotEmpty())
                {
                    return "/" + Area + "/" + ControllerName + "/NewJson";
                }
                return "/" + ControllerName + "/NewJson";
            }
        } 
        public string UrlDeleteJson
        {
            get
            {
                if (Area.IsNotEmpty())
                {
                    return "/" + Area + "/" + ControllerName + "/DeleteJson";
                }
                return "/" + ControllerName + "/DeleteJson";
            }
        }
        public string UrlLoadView
        {
            get
            {
                if (Area.IsNotEmpty())
                {
                    return "/" + Area + "/" + ControllerName + "/LoadPartialView";
                }
                return "/" + ControllerName + "/LoadPartialView";
            }
        }

        public string UrlList
        {
            get
            {

                return "/AutoCompleteData/" + ControllerName + "AutoCompleteData";
            }
        }
        public string UrlGet
        {
            get
            {
                if (Area.IsNotEmpty())
                {
                    return "/" + Area + "/" + ControllerName + "/GetJson";
                }
                return "/" + ControllerName + "/GetJson";
            }
        }
        public string UrlSaveJson
        {
            get
            {
                if (Area.IsNotEmpty())
                {
                    return "/" + Area + "/" + ControllerName + "/SaveJson";
                }
                return "/" + ControllerName + "/SaveJson";
            }
        }

        public int DialogWidth { get; set; }
        public int DialogHeigth { get; set; }
    }
}